package cn.edu.njuit.children.apis;

import cn.edu.njuit.children.common.Result;
import cn.edu.njuit.children.utils.DateUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @Description: TODO
 * @Data: 2022/11/28 18:50
 * @Author: guzy
 */
@RestController
@RequestMapping("/api")
@Api(value = "公开接口", tags = "公开接口")
public class OpenApi {

    @ApiOperation("hello")
    @GetMapping("/hello")
    public Result hello() {
        JSONObject result = new JSONObject();
        result.put("result", "Hello World.");
        return Result.success(result);
    }

    public static void main(String[] args) {
//        PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
//        System.out.println("加密后的密码");
//        System.out.println(passwordEncoder.encode("12356"));

//        System.out.println(new Date());
//        System.out.println(System.currentTimeMillis());
        long d = 1669681970000l;
        Date date = new Date(d);
//        System.out.println(date);
        long l = System.currentTimeMillis();
        System.out.println(l);
        Date date1 = new Date(l);


        System.out.println(DateUtil.getDatePoor(d,l));
    }
}
